from transformers import AutoModelForSequenceClassification,AutoModel,AutoConfig,AutoTokenizer

# model = AutoModel.from_pretrained(r"D:\models\rbt3") #获取模型(AutoModel不建议)
# tokenizer = AutoTokenizer.from_pretrained(r"D:\models\rbt3") #获取tokenizer

model = AutoModelForSequenceClassification.from_pretrained(r"D:\models\rbt3") #获取模型
tokenizer = AutoTokenizer.from_pretrained(r"D:\models\rbt3") #获取tokenizer
inputs = tokenizer("今天天气真好", return_tensors="pt")
res = model(**inputs)
print(res)
model.save_pretrained(r"D:\codes\sshcode\HuggingFace\save_model")#保存模型

# config = AutoConfig.from_pretrained(r"D:\models\rbt3") #获取模型配置信息

